<template>
  <view class="contenter">
    <view class="head u-flex flex_bt">
      <view class="name">今日待服务订单数</view>
      <view class="price">{{list.count}}单</view>
    </view>
    <view class="content">
      <view class="item u-flex flex_bt" v-for="(data,index) in list.service" :key="index">
        <view  class="name">{{data.name}}</view>
        <view class="lv">待服务：{{data.num}}</view>
      </view>
    </view>
    <view class="loading_text" v-if="list.count == 0">
      <text>{{loadingText || '暂无数据'}}</text>
    </view>
  </view>
</template>


<script>
import Indextime from "../../components/index/indexTime";
export default {
  name: "salesVolume",
  components: {Indextime},
  data(){
    return{
      list: {},
      type:'',//1是当日 2是当月
      loadingText:'',
      form:{
        end_time:'',
        start_time:'',
      },
    }
  },
  onLoad(option){
    this.type = option.type
    this.setData()
  },
  methods:{

    setData(){
      if(this.type == 2){
        this.yearChange()
      }
      let form = {
        start_time:this.form.start_time || '',
        end_time:this.form.end_time || '',
      }
      let that = this
      this.$api.serviceList(form).then(res => {
        that.list =res.data
      })
    },


  },
}
</script>

<style scoped lang="scss">
  .contenter{
    margin: 0 32rpx;
    .head{
      margin-top: 20rpx;
      background: white;
      height: 88rpx;
      padding: 0 20rpx;
      .price{
        color: $uni-color-price;
      }
    }
    .content{
      background: white;
      margin-top: 20rpx;
      .item{
        height: 100rpx;
        padding: 0 20rpx;
        border-bottom: 2rpx solid #f2f2f2;
      }
      .name{
        color: #4B4B4B;
        font-size: 28rpx;
        font-weight: bold;
      }
      .lv{
        color: #45806E;
      }
    }

  }
</style>